#include <stdio.h>
#include <stdlib.h>

int gcd(int a, int b)
{
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

int lcm(int a, int b)
{
    int g;

    g = gcd(a, b);
    return a / g * b;
}

int main (int argc, char const* argv[])
{
    int c, n, i, ans, t;

    scanf("%d", &c);

    while (c--) {
        scanf("%d", &n);

        scanf("%d", &ans);
        for (i = 1; i < n; i++) {
            scanf("%d", &t);
            ans = lcm(ans, t);
        }

        printf("%d\n", ans);
    }

    return 0;
}
